#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<string.h>
#include<fcntl.h>
#include<unistd.h>

#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)

char buf1[] = "abcdefghij";
char buf2[] = "ADCDEFGHIJ";

int main(void){
	int fd;
	
	if((fd = creat("file.hole", FILE_MODE)) < 0){
		perror("create error");
		exit(1);
	}

	if(write(fd, buf1, 10) != 10){
		perror("write error");
		exit(1);
	}

	if(lseek(fd, 16384, SEEK_SET) == -1){
		perror("lseek error : ");
		exit(1);
	}

	if(write(fd, buf2, 10) != 10){
		perror("write error");
		exit(1);
	}

	exit(0);
}
